package xin.pms.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
import xin.pms.model.Role;

import java.util.List;

/**
 * <pre>
 * Role Repositroy
 * </pre>
 *
 * @author lixin_ma@outlook.com
 * @version 1.0
 * @since 2018/7/28 15:31
 */
@Repository
public interface RoleRepository  extends PagingAndSortingRepository<Role, String>, JpaSpecificationExecutor<Role>{
    @Query("select r from Role r order by r.priority desc")
    List<Role> getMaxPriority();
}